<?php
/**
 * CreateTime: 2022/5/3 16:03
 */

namespace App\Func;

use App\Models\Dictionary\DictionaryModel;

class DictionaryFunc
{
    public static function getDictionaryInfoByDictionaryId($dictionaryId,array $select){
        $dictionaryModel = new DictionaryModel();
       return $dictionaryModel->getDictionaryInfoByDictionaryId($dictionaryId,$select);
    }

    public static function getDictionaryInfoByDictionaryKey($dictionaryKey,array $select){
        $dictionaryModel = new DictionaryModel();
        return $dictionaryModel->getDictionaryInfoByDictionaryKey($dictionaryKey,$select);
    }

    public static function getDictionaryNodeByDictionKey($dictionaryKey,array $select){
        $dictionaryModel = new DictionaryModel();
        $parentId = $dictionaryModel->getDictionaryInfoByDictionaryKey($dictionaryKey,['dictionary_id'])['dictionary_id'];
        return $dictionaryModel->getDictionaryNodeByDictionaryId($parentId,$select);
    }

    public static function getDictionaryNodeByDictionId($dictionaryId,array $select){
        $dictionaryModel = new DictionaryModel();
        return $dictionaryModel->getDictionaryNodeByDictionaryId($dictionaryId,$select);
    }
}